package com.yanqu.road.server.cmd.chefduel;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.chefduel.ChefDuelProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.chefduel.CrossChefDuelMgr;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.C_CROSS_CHEF_DUEL3_USER_LOGIN, desc = "登录同步一些东西")
public class CrossUserLoginCmd extends CrossCommand {

    int activityId;
    long userId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        ChefDuelProto.CrossChefDuel3LoginSyncMsg reqMsg = ChefDuelProto.CrossChefDuel3LoginSyncMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        userId = reqMsg.getUserId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossChefDuelMgr.syncChefDuel3LoginData(activityId,serverId,userId);
    }

    @Override
    public void sendData() {

    }

}
